package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderDetailMapper {
    /**
     * 批量插入订单明细信息
     * @param orderDetails
     */
    void insertBeach(List<OrderDetail> orderDetails);
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);

    /**
     * 统计日期区间销量前十
     * @param map
     * @return
     */

    List<GoodsSalesDTO> countSalesTop(Map map);
}
